<%@ include file="/WEB-INF/jsp/include.jsp" %>
<head>
	<title><fmt:message key="title"/></title>
	<link rel="stylesheet" type="text/css" href="css/styles.css"/>
</head>
<body>
<spring:hasBindErrors name="login">
    <div class="errorHeading"><fmt:message key="error.heading"/></div>
</spring:hasBindErrors>

<c:if test="${errorMessage != null}">
	<div class="errorHeading">${errorMessage}</div>
</c:if>

<div class="heading">
<fmt:message key="login.heading"/>
</div>
<form method="post" name="LoginForm">
  <table>
    <tr>
      <td alignment="right"><fmt:message key="login.username"/>:</td>
      <spring:bind path="login.username">
        <td>
          <input type="text" name="username" value="<c:out value="${status.value}"/>">
          <span class="errorMessage"><c:out value="${status.errorMessage}"/></span>
        </td>
      </spring:bind>
    </tr>
    <tr>
    	<td alignment="right"><fmt:message key="login.password"/>:</td>
    	<spring:bind path="login.password">
    		<td>
    			<input type="password" name="password" value="<c:out value="${status.value}"/>">
    			<span class="errorMessage"><c:out value="${status.errorMessage}"/></span>
    		</td>
    	</spring:bind>
    </tr>
  </table>
  <input type="submit" alignment="center" value="<fmt:message key="login.button"/>">
</form>
<script type="text/javascript">
  var focusControl = document.forms["LoginForm"].elements["username"];

    if (focusControl.type != "hidden" && !focusControl.disabled) {
         focusControl.focus();
   }
</script>
</body>
</html>